package com.huicoo.forestmanager.network.api;

import com.huicoo.forestmanager.network.bean.alarm.AlarmBean;
import com.huicoo.forestmanager.network.bean.login.LoginResData;
import com.huicoo.forestmanager.network.bean.patrol.AutoinfoBean;
import com.huicoo.forestmanager.network.bean.patrol.EventTypeBean;
import com.huicoo.forestmanager.network.bean.patrol.GetMyForestZoneBean;
import com.huicoo.forestmanager.network.bean.patrol.GetReportTimeSpanBean;
import com.huicoo.forestmanager.network.bean.patrol.GetquerymonthBean;
import com.huicoo.forestmanager.network.bean.patrol.GetrecordschemeBean;
import com.huicoo.forestmanager.network.bean.patrol.PatrolTaskReportPositionBean;
import com.huicoo.forestmanager.network.bean.patrol.PatrolToDoList;
import com.huicoo.forestmanager.network.bean.patrol.RecordDetailsIssuesListBean;
import com.huicoo.forestmanager.network.bean.patrol.RecorddetailsBean;
import com.huicoo.forestmanager.network.bean.patrol.RecordlistBean;
import com.huicoo.forestmanager.network.bean.patrol.ReportEventBean;
import com.huicoo.forestmanager.network.bean.patrol.ReportrecordinfoBean;
import com.huicoo.forestmanager.network.bean.patrol.StartPatrolBean;
import com.huicoo.forestmanager.network.bean.patrol.StopPatrolBean;
import com.huicoo.forestmanager.network.bean.patrol.UploadFileBean;
import com.huicoo.forestmanager.network.bean.patrol.VerifyEventBean;
import com.huicoo.forestmanager.network.bean.patrol.VerifyEventCommentBean;

import java.util.HashMap;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

public interface ApiService {
    @POST(RequestUrl.login)
    @FormUrlEncoded
    Call<LoginResData> login(@Field("account") String username, @Field("password") String password);

    //待巡林班列表
    @GET(RequestUrl.patrolToDoList)
    Call<PatrolToDoList> patrolToDoList(@QueryMap HashMap<String, String> params);

    //获取巡查记录月份
    @GET(RequestUrl.getquerymonth)
    Call<GetquerymonthBean> getquerymonth(@QueryMap HashMap<String, String> params);

    //获取巡查记录
    @GET(RequestUrl.getrecordlist)
    Call<RecordlistBean> getrecordlist(@QueryMap HashMap<String, String> params);

    //获取巡查详细信息
    @GET(RequestUrl.getrecorddetails)
    Call<RecorddetailsBean> getrecorddetails(@QueryMap HashMap<String, String> params);

    //巡查详情问题列表
    @GET(RequestUrl.getRecordDetailsIssuesList)
    Call<RecordDetailsIssuesListBean> getRecordDetailsIssuesList(@QueryMap HashMap<String, String> params);

    //开始巡查
    @GET(RequestUrl.patrolTaskStart)
    Call<StartPatrolBean> patrolTaskStart(@QueryMap HashMap<String, String> params);

    //巡查任务上报位置
    @POST(RequestUrl.patrolTaskReportPosition)
    @FormUrlEncoded
    Call<PatrolTaskReportPositionBean> patrolTaskReportPosition(@FieldMap HashMap<String, String> params);

    //结束巡查
    @POST(RequestUrl.patrolTaskStop)
    @FormUrlEncoded
    Call<StopPatrolBean> patrolTaskStop(@FieldMap HashMap<String, String> params);

    //获取事件类型
    @GET(RequestUrl.getEventType)
    Call<EventTypeBean> getEventType(@QueryMap HashMap<String, String> params);

    //附件上传
    @POST(RequestUrl.uploadFile)
    @Multipart
    Call<UploadFileBean> uploadFile(@PartMap HashMap<String, RequestBody> attachment);

    //事件上报
    @POST(RequestUrl.reportEvent)
    @FormUrlEncoded
    Call<ReportEventBean> reportEvent(@FieldMap HashMap<String, String> params);

    //事件回复
    @POST(RequestUrl.replyEvent)
    @FormUrlEncoded
    Call<VerifyEventBean> replyEvent(@FieldMap HashMap<String, String> params);

    //事件核实
    @GET(RequestUrl.verifyEvent)
    Call<VerifyEventBean> verifyEvent(@QueryMap HashMap<String, String> params);

    //分页获取事件评论
    @GET(RequestUrl.getEventComment)
    Call<VerifyEventCommentBean> getComment(@QueryMap HashMap<String, String> params);

    //分页获取本次任务上报的事件
    @GET(RequestUrl.getRecordDetailsIssuesList)
    Call<RecordDetailsIssuesListBean> getMyReportEvent(@QueryMap HashMap<String, String> params);

    //警情上报
    @POST(RequestUrl.alarm)
    @FormUrlEncoded
    Call<AlarmBean> alarm(@FieldMap HashMap<String, String> params);

    //获取巡查上报位置间隔时间
    @GET(RequestUrl.getReportTimeSpan)
    Call<GetReportTimeSpanBean> getReportTimeSpan(@QueryMap HashMap<String, String> params);

    //获取林长负责林地信息
    @GET(RequestUrl.getMyForestZone)
    Call<GetMyForestZoneBean> getMyForestZone(@QueryMap HashMap<String, String> params);

    //下载附件
    @Streaming //大文件时要加不然会OOM
    @GET
    Call<ResponseBody> downloadFile(@Url String fileUrl);


    //根据登录账号获取巡查方案
    @GET(RequestUrl.getrecordscheme)
    Call<GetrecordschemeBean> getrecordscheme(@QueryMap HashMap<String, String> params);

    //巡查记录报送
    @POST(RequestUrl.reportrecordinfo)
    @FormUrlEncoded
    Call<ReportrecordinfoBean> reportrecordinfo(@FieldMap HashMap<String, String> params);


    //获取巡查自动填报信息
    @GET(RequestUrl.getautoinfo)
    Call<AutoinfoBean> getautoinfo(@QueryMap HashMap<String, String> params);

}
